<?php
class uplogService extends commonService{
    private $table=null;
    public function __construct(){
        parent::__construct();
        $this->table=table('uplog');
    }
    public function _uniq(){
        return md5(time().rand(100000,999999));
    }
    public function add($d){
        return $this->model->_i($this->table,$d);
    }
	
	//上传日志
    public function uplog($data){
        if(!is_array($data)) return false;
        $data['uniq']=md5(time().rand(100000,999999));
        $data['add_time']=time();
        $query="insert into `{$this->table}` 
        (`uniq`,`fileurl`,`filesize`,`fileext`,`kind`,`add_time`) 
        values (:uniq,:fileurl,:filesize,:fileext,:kind,:add_time)";
		$this->m->query($query,array('uniq'=>$data['uniq'],'fileurl'=>$data['fileurl'],'filesize'=>$data['filesize'],'fileext'=>$data['fileext'],'kind'=>$data['kind'],'add_time'=>$data['add_time']));
		return intval($this->m->insert_id());
    }
	
	
//	
}